package com.example.springboot_jap_model.domain.dto;

import com.example.springboot_jap_model.constant.Constant;
import com.example.springboot_jap_model.enums.RespEntityEnum;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class UserDto {

    private Long id;
    private String userName;
    private String realName;
    private String type;
    private String status;
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date addTime;
    private String lostLoinTime;//最后的登录时间 没啥卵用

    public UserDto() {
    }

    public UserDto(Long id, String userName, String realName, Integer type, Integer status, Date addTime, String lostLoinTime) {
        this.id = id;
        this.userName = userName;
        this.realName = realName;
        if (RespEntityEnum.PT_USER.getCode() == type) {
            this.type = RespEntityEnum.PT_USER.getMsg();
        } else if (RespEntityEnum.GL_USER.getCode() == type) {
            this.type = RespEntityEnum.GL_USER.getMsg();
        } else {
            this.type = "其他";
        }
        if (Constant.SUCCESS_STATIC == status) {
            this.status = "正常状态";
        } else {
            this.status = "非正常状态";
        }
        this.addTime = addTime;
        this.lostLoinTime = lostLoinTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public String getLostLoinTime() {
        return lostLoinTime;
    }

    public void setLostLoinTime(String lostLoinTime) {
        this.lostLoinTime = lostLoinTime;
    }

    @Override
    public String toString() {
        return "UserDto{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", realName='" + realName + '\'' +
                ", type=" + type +
                ", status=" + status +
                ", addTime=" + addTime +
                ", lostLoinTime='" + lostLoinTime + '\'' +
                '}';
    }
}
